package study.translation.interpreter;

import java.util.HashMap;
import java.util.Map;

public class GlobalContext
{
    private Map<String, Subroutine> subroutines = new HashMap<String, Subroutine>();

    public void registerSubroutine( Subroutine s )
    {
        subroutines.put( s.getName(), s );
    }

    public Subroutine getSubroutine( String name )
    {
        return subroutines.get( name );
    }

    public boolean subroutineExists( String name )
    {
        return subroutines.containsKey( name );
    }
}
